package com.hyt.it.ogt.ykcj.mq;

import com.hyt.it.ogt.common.config.MQConfigManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 同步考试数据到成绩队列消息生产者
 *
 * @author yanghuankun@talkweb.com.cn
 * @date 2023-4-10
 */
@Component
@Slf4j
public class SyncCandidateToCjProducer {

    @Resource
    MQConfigManager mqConfigManager;
    @Resource
    RabbitTemplate rabbitTemplate;

    /**
     * 推送消息
     *
     * @param apiLogId
     */
    public void sendMessage(String msg) {
        // 推送一个消息
        rabbitTemplate.convertAndSend(mqConfigManager.getKzToKhDirect(), mqConfigManager.getGroupSyncCandidateToCjRoute(), msg);
    }
}
